@echo off
echo 配置ngrok内网穿透...
echo.

REM 检查ngrok是否已安装
where ngrok >nul 2>nul
if %errorlevel% neq 0 (
    echo 正在下载ngrok...
    powershell -Command "Invoke-WebRequest -Uri 'https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-windows-amd64.zip' -OutFile 'ngrok.zip'"
    powershell -Command "Expand-Archive -Path 'ngrok.zip' -DestinationPath '.' -Force"
    del ngrok.zip
    echo ngrok下载完成！
) else (
    echo ngrok已安装
)

echo.
echo 启动ngrok隧道...
echo 请访问 https://dashboard.ngrok.com/ 注册免费账号
echo 获取authtoken后运行: ngrok config add-authtoken YOUR_TOKEN
echo.
echo 然后运行: ngrok http 8080
echo.

pause 